<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>定期工作列表</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="referrer" content="never" />
		<link rel="stylesheet" href="../../../css/mui.min.css">
		<link rel="stylesheet" href="../static/css/common.css" />	
		<link rel="stylesheet" href="../static/components/components.css" />	
		<link rel="stylesheet" href="../static/css/terminalwork.css" />	
		<script src="../../../js/mui.min.js"></script>
		<script src="../../../js/vue.js"></script>
		<script type="text/javascript" src="../../../js/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="../static/js/neiosRequst.js"></script>  <!--请求接口页面必需-->
		<script src="../static/js/neiosCommon.js"></script>  <!--公共js页面必需-->
		<script src="../static/js/Config.js"></script>
		<script src="../static/components/personSelect.js"></script>
		<script src="../static/components/multipleSelect.js"></script>
		<style>
			.terminalwork-list{
				/* height:calc(100vh - 65px); */
			}
		</style>
	</head>
	<body>
		<!-- <header class="mui-bar mui-bar-nav mui-bar-nav-bg">
			<h1 id="title" class="mui-title">工作台</h1>
		</header> -->
		<header class="mui-bar mui-bar-nav mui-bar-nav-bg">
			<h1 id="title" class="mui-title" style="width:50%;left:0">工作台</h1>
			<div class="neios-station-change">
				<div class="neios-station-name"></div>
				<div class="neios-station-btn" style="display:none;">切换</div>
			</div>
		</header>
		<div id="terminalwork" style="margin-top:50px;">
			<div class="neios-station-dialog-box">
				<div class="neios-station-dialog">
					<div class="neios-station-dialog-item"
					 v-for='(item,index) in stationList'
					 @click="changeStation(item)">{{item.name}}</div>
				</div>
			</div>
			<div class="top">
				<div class="search-model" style="width:calc(100% - 15vw)">
					<div class="mui-input-row mui-search">
						<input type="search" class="mui-input-clear" 
						style="background-color: #fff;" placeholder="请输入工作名称"
						 v-model="terminalKeyword" maxlength="45" @input="terminalKeywordChange()">
					</div>
				</div>
				<div class="top-textall">
					<span @click="changeSearchType('todo')" v-if="searchType == 'toreceive'">待领</span>
					<span @click="changeSearchType('toreceive')" v-if="searchType == 'todo'">待办</span>
				</div>
			</div>
			<div class="nodata-tips" v-if="terminalworkList.length == 0">暂无数据！</div>
			<div id="terminalworkList">
				<div class="list" id="list" v-if="isShowList">
					<div v-for="(item,index) in terminalworkList" :key="index" class="terminalwork-list-item">
						<div class="terminalwork-list-title" @click="hideOperBtn()">任务内容：{{item.workTypeName}}</div>
						<div class="terminalwork-list-sec" v-if="searchType == 'toreceive'" @click="hideOperBtn()">
							<span>生成时间：{{item.createDate}}</span>
						</div>
						<div class="terminalwork-list-sec" v-if="searchType == 'todo'" @click="hideOperBtn()">
							<div>截至时间：{{item.workEndDate}}</div>
							<div>发起人：{{"["+item.nodeCreateStaffCode+"]"+item.nodeCreateStaffName}}</div>
						</div>
						<div class="terminalwork-list-receivebtn" v-if="searchType == 'toreceive'" onclick="showAppointBtn(this)">操作</div>
						<div class="terminalwork-list-operbtn toAppoint">
							<div class="terminalwork-list-operbtn-in">
								<div class="operbtn" @click="showReceiveBtn(item)">领取</div>
								<div class="operbtn" @click="showAppointBtn(item)">指派</div>
							</div>
						</div>
						<div class="terminalwork-list-receivebtn" v-if="searchType == 'todo'" onclick="showOperBtn(this)">操作</div>
						<div class="terminalwork-list-operbtn todo">
							<div class="terminalwork-list-operbtn-in">
								<div class="operbtn" @click="doWork(item)">办理</div>
								<div class="operbtn" @click="terminalDelay(item)" v-if="item.delay==0 && isSelectDay > 1 && item.workTerm != -1">延期</div><!--延期一次之后不能再延期需要判断-->
								<div class="operbtn" @click="terminalTransfer(item)">转办</div>
							</div>
						</div>
					</div>
				</div>	
			</div>
			<!--延期-->
			<div class="explain-dialog" v-if="isShowTerminalDelay">
				<div class="explain-in">
					<div class="explain-header">延期</div>
					<div class="explain-con">
						<div class="explain-con-title">选择延期天数</div>
						<div style="padding:2vw 5vw" v-for="(item,index) in DELAY_DAY">
							<input type="radio" name="terminalDelay" :value="item.itemValue" 
							style="width:4vw;height:4vw" :disabled="isSelectDay < item.itemValue"/>
							<span>{{item.itemText}}</span>
						</div>
					</div>
					<div style="display:flex">
						<div class="explain-btn explain-btn-main" style="width:50%" @click="terminalDelaySure()">确定</div>
						<div class="explain-btn" style="width:50%" @click="terminalDelayCacel()">取消</div>
					</div>
				</div>
			</div>
			<!--转办-->
			<div class="explain-dialog" v-if="isShowTerminalTransfer">
				<div class="explain-in">
					<div class="explain-header">转办</div>
					<div class="explain-con">
						<div style="margin:5vw 5vw 0;">
							<div class="neios-form-item">
								<div class="neios-form-item-lable" style="width:30%;">办理人<span class="red">*</span></div>
								<div class="neios-form-item-con" style="width:70%;">
									<personselect :issingle="isSingle" ref="transferPerson"></personselect>
								</div>
							</div>
						</div>
					</div>
					<div style="display:flex">
						<div class="explain-btn explain-btn-main" style="width:50%" @click="terminalTransferSure()">确定</div>
						<div class="explain-btn" style="width:50%" @click="terminalTransferCacel()">取消</div>
					</div>
				</div>
			</div>
			<!--领取-->
			<div class="explain-dialog" v-if="isShowTerminalReceive">
				<div class="explain-in">
					<div class="explain-header">任务领取</div>
					<div class="explain-con">
						<div v-if="selectRow.workType == '0101' || 
						selectRow.workType == '0112' || 
						selectRow.workType == '0114' || 
						selectRow.workType == '0116' || 
						selectRow.workType == '0117'">
							<div class="explain-con-title">选择监护人</div>
							<div class="neios-form-explain">请确认线下已与所选监护人沟通</div>
							<div class="neios-form-item" style="margin:0 5vw;">
								<div class="neios-form-item-lable" style="width:10%;"><span class="red">*</span></div>
								<div class="neios-form-item-con" style="width:90%;">
									<personselect :issingle="isSingle" ref="personselectRecieve"></personselect>
								</div>
							</div>
						</div>
						<!--安全设施定期检查流程显示-->
						<div v-if="selectRow.workType == '0111'">
							<div class="explain-con-title">选择搭档检查人</div>
							<div class="neios-form-explain">请确认线下已与所选监护人沟通</div>
							<div class="neios-form-item" style="margin:0 5vw;">
								<div class="neios-form-item-lable" style="width:10%;"><span class="red">*</span></div>
								<div class="neios-form-item-con" style="width:90%;">
									<personselect :issingle="isSingle" ref="personselectRecieveSec"></personselect>
								</div>
							</div>
						</div>
						<!--蓄电池流程显示-->
						<div v-if="selectRow.workType == '0101'">
							<div class="explain-con-title">选择本月蓄电池测量信息</div>
							<div class="neios-form-item" style="margin:0 5vw 15px;">
								<div class="neios-form-item-lable" style="width:40%;">保护用蓄电池</div>
								<div class="neios-form-item-con" style="width:60%;">
									<multipleselect placeholder="请选择"
									:miltipleselectlist="protectList"
									lable="itemText"
									value="itemValue" ref="groupProtect"></multipleselect>
								</div>
							</div>
							<div class="neios-form-item" style="margin:0 5vw 15px;">
								<div class="neios-form-item-lable" style="width:40%;">通信蓄电池</div>
								<div class="neios-form-item-con" style="width:60%;">
									<multipleselect placeholder="请选择"
									:miltipleselectlist="protectList"
									lable="itemText"
									value="itemValue" ref="groupSignal"></multipleselect>
								</div>
							</div>
						</div>
					</div>
					<div style="display:flex">
						<div class="explain-btn explain-btn-main" style="width:50%" @click="terminalReceiveSure()">确定</div>
						<div class="explain-btn" style="width:50%" @click="terminalReceiveCacel()">取消</div>
					</div>
				</div>
			</div>
			
			<!--指派-->
			<div class="explain-dialog" v-if="isShowAppoint">
				<div class="explain-in">
					<div class="explain-header">任务指派</div>
					
					<div class="explain-con">
						<div v-if="selectRow.workType != '0111'">
							<div class="explain-con-title">选择指派人</div>
							<div class="neios-form-explain">请确认线下已与所选指派人沟通</div>
							<div class="neios-form-item" style="margin:0 5vw;">
								<div class="neios-form-item-lable" style="width:10%;"><span class="red">*</span></div>
								<div class="neios-form-item-con" style="width:90%;">
									<personselect :issingle="isSingle" ref="appointSingle"></personselect>
								</div>
							</div>
						</div>
						<div v-if="selectRow.workType == '0111'">
							<div class="explain-con-title">选择指派人(至少两个)</div>
							<div class="neios-form-explain">请确认线下已与所选指派人沟通</div>
							<div class="neios-form-item" style="margin:0 5vw;">
								<div class="neios-form-item-lable" style="width:10%;"><span class="red">*</span></div>
								<div class="neios-form-item-con" style="width:75%;">
									<personselect :issingle="appointPersin" @change="itemChange()" ref="appointMulti"></personselect>
								</div>
								<div style="margin-left: 2vw;" @click="clearPersion()">清空</div>
							</div>
						</div>
						<div v-if="selectRow.workType == '0101' || selectRow.workType == '0112' || selectRow.workType == '0114'">
							<div class="explain-con-title">选择监护人</div>
							<div class="neios-form-explain">请确认线下已与所选监护人沟通</div>
							<div class="neios-form-item" style="margin:0 5vw;">
								<div class="neios-form-item-lable" style="width:10%;"><span class="red">*</span></div>
								<div class="neios-form-item-con" style="width:90%;">
									<personselect :issingle="isSingle" ref="appointPerson"></personselect>
								</div>
							</div>
						</div>
						<!--蓄电池流程显示-->
						<div v-if="selectRow.workType == '0101'">
							<div class="explain-con-title">选择本月蓄电池测量信息</div>
							<div class="neios-form-item" style="margin:0 5vw 15px;">
								<div class="neios-form-item-lable" style="width:40%;">保护用蓄电池</div>
								<div class="neios-form-item-con" style="width:60%;">
									<multipleselect placeholder="请选择"
									:miltipleselectlist="protectList"
									lable="itemText"
									value="itemValue" ref="groupProtect"></multipleselect>
								</div>
							</div>
							<div class="neios-form-item" style="margin:0 5vw 15px;">
								<div class="neios-form-item-lable" style="width:40%;">通信蓄电池</div>
								<div class="neios-form-item-con" style="width:60%;">
									<multipleselect placeholder="请选择"
									:miltipleselectlist="protectList"
									lable="itemText"
									value="itemValue" ref="groupSignal"></multipleselect>
								</div>
							</div>
						</div>
					</div>
					<div style="display:flex">
						<div class="explain-btn explain-btn-main" style="width:50%" @click="appointSure()">确定</div>
						<div class="explain-btn" style="width:50%" @click="appointCacel()">取消</div>
					</div>
				</div>
			</div>
		</div>
		<script src="terminalwork.js"></script>
	</body>
</html>
